<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Star(name,age){
            this.name = name;
            this.age = age;
            // this.sing = function(){
            //     console.log(1);
                
            // }
            // Star.prototype.sing = function(){
            //     console.log(1);
                
            // }
            Star.prototype = {
                // constructor:Star,
                      sing:function(){
                          console.log(1);
                          
                      },
                      mov:function(){
                          console.log(2);
                          
                      }
            }

        }
        var l = new Star('ss',1)
        var k = new Star('sss',11)
        // console.log(l.sing===k.sing);
        // 放到构造函数的原型链里之后
        console.log(l.__proto__);
        console.log(Star.prototype);
        
        // console.log(l.__proto__.constructor);
        
        // console.log(Star);
        // console.dir(Star)

        
    </script>
</body>
</html>